package com.kgc.manager.controller;

import com.kgc.entity.TbContentCategory;
import com.kgc.manger.service.ContentCatService;
import com.kgc.utils.ResultTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.xml.transform.Result;
import java.util.List;


@Controller
public class ContentCatController {
    @Autowired
    private ContentCatService contentCatService;
    @RequestMapping("listCat")
    @ResponseBody
    public ResultTable findAll(){
        List<TbContentCategory> list = contentCatService.findAll();
        ResultTable resultTable=new ResultTable();
        resultTable.setCode(0);
        resultTable.setCount(list.size());
        resultTable.setData(list);
        return resultTable;
    }

    @RequestMapping("cat/{page}")
    public String page(@PathVariable("page")String page){
        return page;
    }
}
